{% extends 'shop/base.html' %}

{% block title %}{{ title }}{% endblock %}

{% block content %}
<h1 class="mb-6 text-3xl">{{ title }}</h1>

<form method="post" action="." enctype="multipart/form-data">
    {% csrf_token %}

    <div class="space-y-4">
        {{ form.as_p }}
    </div>

    {% if form.errors or form.non_field_errors %}
        <div class="mb-3 p-6 bg-red-100 rounded-xl">
            {% for field in form %}
                {{ field.errors }}
            {% endfor %}

            {{ form.non_field_errors }}
        </div>
    {% endif %}

    <button class="mt-6 py-4 px-8 text-lg bg-teal-500 hover:bg-teal-700 rounded-xl text-white">提交</button>
</form>
{% endblock %}
